<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        // 定义构造函数
        function Employee(name, age) {
            this.name = name;
            this.age = age;

            // 方法挂载原型上
            Employee.prototype.say = function () {
                console.log(this.name + '-' + this.age)
            }
        }
        var employee1 = new Employee('pick', 32);
        employee1.say()
    </script>
</body>

</html>